package com.common.core.domain;

import com.fasterxml.jackson.annotation.JsonFormat;

import java.io.Serializable;
import java.util.Date;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

/**
 * Entity基类
 * 
 * @author ruoyi
 */
public class BaseEntity implements Serializable
{
    private static final long serialVersionUID = 1L;

//    public BaseEntity(){
//        if(createBy==null){
//            HttpServletRequest request = ServletUtils.getRequest();
//            if(request!=null){
//                String username = request.getHeader(CacheConstants.DETAILS_USERNAME);
//                if(StringUtils.isNotEmpty(username)){
//                    createBy = ServletUtils.urlDecode(username);
//                }
//            }
//        }
//        createTime = createTime == null ? DateUtils.getNowDate() : createTime;
//    }

    /** 搜索值 */
    private String searchValue;

    /** 创建者 */
    private String createBy;

    /** 创建时间 */
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private Date createTime;

    /** 更新者 */
    private String updateBy;

    /** 更新时间 */
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private Date updateTime;

    /** 备注 */
    private String remark;

    /** 请求参数 */
    private Map<String, Object> params;

    //--------工作流审批--------
    /**
     * 是否具有审批权限
     */
    private boolean checkPermission = false;

    /**
     * 用户审批意见
     */
    private boolean userOpinion = false;

    /**
     * 审批意见信息,备注
     */
    private String opinionMessage;

    /**
     * 流程是否全部结束
     */
    private boolean finish = false;

    /**
     * 工作流使用实际就是ExecutionId
     */
    private Long checkId;

    /**
     * 该步骤审核流程集合
     */
    private List activityList = null;

    /**
     * 当前审批人
     */
    private String currentName;

    /**
     * 用来编辑菜单时判断是否更改了工作流,新增时true,修改时不改变工作流false改变true
     */
    private boolean haveActivity = false;

    /**
     * 引用工作流key
     */
    private String proKey;


    public String getSearchValue()
    {
        return searchValue;
    }

    public void setSearchValue(String searchValue)
    {
        this.searchValue = searchValue;
    }

    public String getCreateBy()
    {
        return createBy;
    }

    public void setCreateBy(String createBy)
    {
        this.createBy = createBy;
    }

    public Date getCreateTime()
    {
        return createTime;
    }

    public void setCreateTime(Date createTime)
    {
        this.createTime = createTime;
    }

    public String getUpdateBy()
    {
        return updateBy;
    }

    public void setUpdateBy(String updateBy)
    {
        this.updateBy = updateBy;
    }

    public Date getUpdateTime()
    {
        return updateTime;
    }

    public void setUpdateTime(Date updateTime)
    {
        this.updateTime = updateTime;
    }

    public String getRemark()
    {
        return remark;
    }

    public void setRemark(String remark)
    {
        this.remark = remark;
    }

    public Long getCheckId() {
        return checkId;
    }

    public void setCheckId(Long checkId) {
        this.checkId = checkId;
    }

    public List getActivityList() {
        return activityList;
    }

    public void setActivityList(List activityList) {
        this.activityList = activityList;
    }

    public String getCurrentName() {
        return currentName;
    }

    public void setCurrentName(String currentName) {
        this.currentName = currentName;
    }

    public boolean isHaveActivity() {
        return haveActivity;
    }

    public void setHaveActivity(boolean haveActivity) {
        this.haveActivity = haveActivity;
    }

    public String getProKey() {
        return proKey;
    }

    public void setProKey(String proKey) {
        this.proKey = proKey;
    }

    public boolean isCheckPermission() {
        return checkPermission;
    }

    public void setCheckPermission(boolean checkPermission) {
        this.checkPermission = checkPermission;
    }

    public boolean isUserOpinion() {
        return userOpinion;
    }

    public void setUserOpinion(boolean userOpinion) {
        this.userOpinion = userOpinion;
    }

    public String getOpinionMessage() {
        return opinionMessage;
    }

    public void setOpinionMessage(String opinionMessage) {
        this.opinionMessage = opinionMessage;
    }

    public boolean isFinish() {
        return finish;
    }

    public void setFinish(boolean finish) {
        this.finish = finish;
    }

    public Map<String, Object> getParams()
    {
        if (params == null)
        {
            params = new HashMap<>();
        }
        return params;
    }

    public void setParams(Map<String, Object> params)
    {
        this.params = params;
    }
}
